import { ref } from "vue";

export default function useCountdown(number:any){

  const result = ref(number)

   var timer = setInterval(() => {
    result.value--

    console.log(timer)

    if(result.value<=0){
      window.clearInterval(timer)
    }
      
  }, 1000);

  return result

}